This invention relates to processing of telephony samples.
Telephony samples representing, e.g., voice telephone calls, are sometimes communicated using time division multiplexed (TDM) channels.
To recover the samples belonging to each of the channels, a received TDM stream may be de-multiplexed in a telephony gateway. For use in later communication and processing of each channel, its samples may be encapsulated in packets containing one or more samples per packet, in accordance with a protocol such as the real-time transport protocol (RTP). An RTP packet also includes a header containing a timestamp that represents the time when the first sample in the RTP packet was created. Each RTP packet can be compressed or, if it contains only silence, eliminated altogether. Typical compressed RTP packet formats follow ITU-T recommendation G.723.1 or G.729. We consider G.711 to be an uncompressed format, although the individual samples are encoded using an 8-bit floating point format (A-law or xcexc-law), as are TDM samples.
A delay occurs between the time of arrival of the first TDM sample that is to become part of an RTP packet and the time when all of the samples for that packet have arrived and can be assembled. For example, a packet that contained 20 milliseconds of samples would be delayed by the 20 milliseconds needed to assemble all of its samples.
In the opposite xe2x80x9cdirectionxe2x80x9d, samples from incoming RTP packets may be multiplexed into a TDM stream. This is typically done using a set of so-called jitter buffers, one for each of the incoming channels. The communication links that carry incoming RTP packets may cause individual packets to be delayed, or even lost, and the RTP packets may arrive at the gateway in the wrong order. By using the timestamp information in the header of each packet, the arriving packets can be put into the correct order in the jitter buffers, and missing packets can be replaced. Samples decompressed from the first packet in each jitter buffer may then be interleaved to form the multiplexed TDM stream. In order to have samples available when needed, each jitter buffer delays the readout of incoming packets to leave enough time for out-of-order or delayed packets to arrive.
Typically, conferencing of multiple channels is done by combining TDM samples. If any of the voice samples to be conferenced is received as RTP packets, the packets are normally first converted to a TDM stream.
In general, the invention features a method that includes receiving packets containing isochronous samples and, without first storing the packets in a jitter buffer, storing the samples in a buffer at locations chosen based on the times of the samples.
Implementations of the invention may include one or more of the following features. The isochronous samples are telephony samples. The buffer includes a circular buffer, and consecutive locations in the buffer are associated respectively, at a current time, with a sequence of time values. The samples are also read from locations of the buffer. The location of the buffer associated with the earliest time-value immediately follows the location associated with the latest time value. The time-values associated with at least some of the locations are changed by an amount corresponding to a length of the buffer. The time values are changed at times that are separated by a fixed interval. Some of the locations include consecutive locations that start with a location that is associated with the earliest time value. Consecutive locations of the buffer are associated with successive times including past times, a current time, and future times. The received samples are stored in locations associated with future times and are read at locations associated with past times. The received packets are decompressed before their samples are stored in the buffer. The received packets include packets that comply with a real-time transport protocol (RTP).
Other isochronous samples (e.g., representing another channel) are also received and stored in another buffer at locations chosen based on the times of the other samples. The other samples are read from successive locations of the other buffer in synchronism with the reading of the samples from the first buffer. The samples that are read in synchronism are combined to form a single channel of isochronous samples. Additional channels can be stored in other buffers and combined into one channel. The technique enables conferencing of two or more telephony channels, for example.
Information is maintained that identifies samples that are not valid to be read. The information includes bits each of which indicates whether a single corresponding sample is valid to be read. Or the information includes bits each of which indicates whether a corresponding group of consecutive samples is valid to be read. Or the information can include a list of ranges of locations containing samples that are valid to be read. Or the information includes run-length encoded information.
Filler samples are substituted in locations in the buffer in place of, e.g., non-valid samples. The filler samples are generated based on information contained in other samples. Or the filler samples are generated based on information in subsequent packets.
The reading of samples from the buffer occurs at spaced apart times. Other processing of samples occurs in the intervals between the spaced apart times. The samples are stored in the buffer at locations that are based on timestamp information carried in the packets and on an offset value associated with the channel that carried the packets. Filler samples are stored in the buffer in connection with missing or discarded packets. The offset value is adjusted in response to early- or late-arriving packets which may be due to the drifting of a source clock used in assembling the packets.
In general, in another aspect, the invention features apparatus that includes a buffer configured to accept isochronous samples of packets and to store the samples at locations of the buffer that are chosen based on the times of the samples.
Among other advantages, the invention allows isochronous mixing of TDM and RTP data in a way that minimizes delay and accommodates the simultaneous use of a variety of RTP packet sizes, latencies, and latency variations (jitter).
Other advantages and features will become apparent from the following description and from the claims.